package com.superlistaportable.sales;

import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import com.example.superlistaportable.R;

public class SalesView extends View{
	private final SalesActivity activity;
	private final SalesModel model;
	
	public SalesView(SalesActivity activity, SalesModel model) {
		super(activity, null);
		
		this.activity = activity;
		this.model = model;
		activity.setContentView(R.layout.sales_list);
		updateListView();
	}
	
	public void updateListView() {
		ListView lv = (ListView) activity.findViewById(R.id.salesList);
        lv.setAdapter(new SalesAdapter(this.activity,this.model,model.getNewStatuses()));
	}
	
	public Button getUpdateSalesButton(){
    	return (Button) activity.findViewById(R.id.updateSalesButton);
    }
}
